package com.zpark.servlet_context;

import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @PackageName: com.zpark.servlet_context
 * @ClassName: ServletContextDemo02
 * @Description:
 * @author: RZS
 * @date: 2023/3/8  8:56
 */
@WebServlet("/sc02.do")
public class ServletContextDemo02 extends HttpServlet {
    @Override
    protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        // 获取servletContext对象
        ServletContext servletContext = req.getServletContext();
        System.out.println("*********************************************");
        System.out.println(servletContext);
    }
}
